package com.example.springboot.service;

import com.example.springboot.entity.ForumPostImage;
import com.example.springboot.mapper.ForumPostImageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ForumPostImageService {

    @Autowired
    private ForumPostImageMapper forumPostImageMapper;

    public void addImage(ForumPostImage image) {
        forumPostImageMapper.insertImage(image);
    }

    public void deleteImage(Integer imageId) {
        forumPostImageMapper.deleteImage(imageId);
    }

    public List<ForumPostImage> getImagesByPostId(Integer postId) {
        return forumPostImageMapper.selectImagesByPostId(postId);
    }
}